package com.erbao.gc;

/**
 * lambda表达式，会生成内部类
 * 演示方法区溢出，需要添加JVM参数。-XX:MaxMetaspaceSize=9M
 * @author CaoBaoYin
 * @since 2022/4/17 11:46
 */
public class LambdaGc {
    public static void main(String[] args) {
        for(;;) {
            I i = C::n;
        }
    }

    public static interface I {
        void m();
    }

    public static class C {
        static void n() {
            System.out.println("hello");
        }
    }
}
